package com.itheima.demo01.Exception;

public class Demo02Exception {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        int ele = 0;
        try {
            ele = getElement(arr, 3);
        } catch (Exception e) {
            System.out.println(e);
        }

        System.out.println(ele);
    }

    public static int getElement(int[] arr, int index) {
        int ele = arr[index];
        return ele;
    }
}
